{	Problem: http://codechef.com/problems/HS08TEST/
 	Verdict: Accepted
}
var n:int64; t:double;
begin
read(n,t);
if (n<=t-0.5) and (n mod 5=0) then t:=t-n-0.5;
write(t:0:2);
readln(t);
end.